Retirement Planning


Kerry Back

BUSI 721, Fall 2022
JGSB, Rice University


  • Let’s track a retirement account balance monthly.
  • For simplicity, assume the return is the same each month.
  • We’ll first track it in a loop, then use future values.

Our goal

  • Count the dates 0, 1, 2, …
  • Today is date 0, date 1 is 1 month away, \(\ldots\)
  • We make deposits at dates \(1, 2, \ldots, R\)
  • Date R (R months away) is our retirement date
  • We plan to live until date \(T>R\).
  • We make withdrawals at the beginning of each month of retirement: dates \(R, R+1, \ldots, N-1\)

  • Our account balance today is \(B_0\).
  • We earn a return \(r\) each month (like 1/2 percent or so).
  • At date 1, we have \((1+r)B_0\) and deposit \(D_1\), so \(B_1 = (1+r)B_0 + D_1\).
  • Likewise, \(B_2 = (1+r)B_1 + D_2\).
  • Etc., until \(B_R = (1+r)B_{R-1} + D_R\).

  • We make our first withdrawal at date \(R\), so actually \(B_R = (1+r)B_{R-1} + D_R - W_R\).
  • Subsequently, \(B_t = (1+r)B_{t-1} - W_t\) until \(t=T-1\).
  • Then \(B_T = (1+r)B_{T-1}\) is our bequest.

  • Assume deposits grow at some rate \(g\), so
    \(D_2=(1+g)D_1\)
    \(D_3 = (1+g)D_2 = (1+g)^2D_1\)
    etc.
  • Assume withdrawals are a constant amount \(W\)
  • inputs are \(R\), \(T\), \(r\), \(g\), \(D_1\), \(W\)
  • deposits are
    D = D1 * [1, 1+g, (1+g)**2, …, (1+g)**(R-1)]

Example

R = 30*12      # 30 years until retirement
T = 60*12      # 60 total years
r = 0.005      # earn 1/2 % per month  (~ 6% per year)
g = 0.002      # deposit is 0.2% larger each month
B0 = 100000    # initial balance is $100,000
D1 = 1000      # initial savings is $1,000 (per month)
W = 10000      # withdraw $10,000 per month in retirement

Solution

D = D1 * (1+g)**np.arange(R)  
B = np.zeros(T+1)
B[0] = B0

for i in range(1, R+1) :               
    B[i] = (1+r)*B[i-1] + D[i-1] 

B[R] -= W

for i in range(R+1, T):
    B[i] = (1+r)*B[i-1] - W

B[T] = (1+r)*B[T-1]

Final balance as sum of future values

# future value of initial balance
FVB = B0 * (1+r)**T

# future values of deposits
FVD = D * (1+r)**np.arange(T-1, T-R-1, -1)

# future values of withdrawals
FVW = W * (1+r)**np.arange(T-R, 0, -1)

# account balance at end
BT = FVB + np.sum(FVD) - np.sum(FVD)

Success!